﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Problema1
{
    public class persoana
    {
        private string nume;
        private int varsta;
        private Queue<masina> listaMasini;
        public persoana()
        {
            Console.Write("Nume persoana : ");
            nume = Console.ReadLine();
            Console.Write("Varsta persoana : ");
            varsta = Convert.ToInt32(Console.ReadLine());
            listaMasini = new Queue<masina>();
        }
        public void adaogaMasina(masina x)
        {
            this.listaMasini.Enqueue(x);
        }
        public bool areNumele(string n)
        {
            return nume.Equals(n);
        }

        internal void printData()
        {
            Console.Write("Nume : " + nume + "\r\nVarsta : " + varsta.ToString() + "\r\nMasini asociate :\r\n");
            foreach (masina i in listaMasini)
                i.printData();
        }
    }
}
